package com.wishu.finance.enums;

public enum InstalmentPeriodTypeEnum {

    SHIER("12个月", 12),
    ERSHISI("24个月", 24),
    WUXIANQI("无限期", -1);

    private String name;
    private int index;

    private InstalmentPeriodTypeEnum(String name, int index) {
        this.name = name;
        this.index = index;
    }

    public static String getName(int index) {
        for (InstalmentPeriodTypeEnum c : InstalmentPeriodTypeEnum.values()) {
            if (c.getIndex() == index) {
                return c.name;
            }
        }
        return null;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

}
